﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace eStock.hControl
{
    public partial class hDataGridViewNumberBoxColumn : DataGridViewTextBoxColumn
    {
        public hDataGridViewNumberBoxColumn()
        {
            InitializeComponent();
        }

        public hDataGridViewNumberBoxColumn(IContainer container)
        {
            container.Add(this);
            InitializeComponent();
        }

        protected bool hNotEmpty = false;
        [Category("1-HCOM"), Description("Kiểm tra trống")]
        public bool NotEmpty
        {
            get { return hNotEmpty; }
            set { hNotEmpty = value; }
        }

        public override object Clone()
        {
            hDataGridViewNumberBoxColumn clone = (hDataGridViewNumberBoxColumn)base.Clone();
            clone.NotEmpty = NotEmpty;

            DataGridViewCellStyle cellStyle = new DataGridViewCellStyle();
            cellStyle.Format = "N0";
            cellStyle.NullValue = null;
            clone.DefaultCellStyle = cellStyle;

            return clone;
        }
    }
}
